package com.hmall.gateway.filter;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * @Author:篍
 * @Date: 2025/09/05 17:45
 * @Description:
 */
@Component
@Slf4j
//默认过滤器
public class Test2GatewayFilterFactory extends AbstractGatewayFilterFactory<Object> implements Ordered {
    @Override
    public GatewayFilter apply(Object config) {
        return (exchange, chain) -> {
            System.out.println("TestGatewayFilterFactory");
            return chain.filter(exchange);
        };
    }

    @Override
    public int getOrder() {
        return Integer.MAX_VALUE;
    }
}
